#!/usr/bin/python3

try:
    t = int(input())
    for x in range(t):
        a_str = [int(item) for item in input().split()]
        a = a_str[0]
        b = a_str[1]
        c = a_str[2]
        a_str[0] = a*b
        a_str[1] = b*c
        a_str[2] = c*a

        print("Case #%d: %s" % (x + 1, max(a_str)))

except ValueError:
    pass
except EOFError:
    pass
except MemoryError:
    pass
